UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '16n9NyHyI8Z2+h6B2je+Vj+bzX5RRtXrtJ08CLWxe64=' 
WHERE 
  key_id = '890f43c77ec0869120b7770085c87b4ae62e4f0eb01b1f1548a0d197f1760cf8' 
  AND (
    token = '16n9NyHyI8Z2+h6B2je+Vj+bzX5RRtXrtJ08CLWxe64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027