UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j9FLcMkETHLdhWzVFy13bYkpe5ijeCtyZN5HEjIf924=' 
WHERE 
  key_id = 'ec4b6d04e88b293ec9ce3a1f9f1ea694cf842bc966d017597332f055775eec5d' 
  AND (
    token = 'j9FLcMkETHLdhWzVFy13bYkpe5ijeCtyZN5HEjIf924=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022