UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VN135Z/E1rZhYKAIcOl/HM6z5/dQAfCh17vYDFnngjk=' 
WHERE 
  key_id = '1abaca42fb155c78c221f23163abd5e214264d7fa291d74f125a0ab21d0f9d2e' 
  AND (
    token = 'VN135Z/E1rZhYKAIcOl/HM6z5/dQAfCh17vYDFnngjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022