UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VGEvXbUh95C1BGtlEypzyJfj/1HiH4AfP/qM7Guv0o0=' 
WHERE 
  key_id = 'd539c39db9c614148659ffe5983f71c710d99085ec60c874bcc7001ff6be281b' 
  AND (
    token = 'VGEvXbUh95C1BGtlEypzyJfj/1HiH4AfP/qM7Guv0o0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027