UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3OqurXxJZveO5KJDvfFwLEGfCnJtp2qZsJxDcSQb/iw=' 
WHERE 
  key_id = '0376103015323493ca69e9788c9f9591c7a5f3069b81c94bb43f50c2b9b9ec20' 
  AND (
    token = '3OqurXxJZveO5KJDvfFwLEGfCnJtp2qZsJxDcSQb/iw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039