UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IYlZKORy/ogdZjUA74blinyRlC6fZEiDyyIlaTSmwWA=' 
WHERE 
  key_id = 'ea5e17ea66481dfc19536b534e02a0adcdd32535e5a5be28eb6eae98652cc7ec' 
  AND (
    token = 'IYlZKORy/ogdZjUA74blinyRlC6fZEiDyyIlaTSmwWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038