UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JPCg1IRVkhSQd4e8iJ26k6TfDqqN9tP5Aw9l9M3qagI=' 
WHERE 
  key_id = '6aa2a78cc8fce25d8a03e9043a4cbf100fd8dc4930b16aa476413fe203d53cb2' 
  AND (
    token = 'JPCg1IRVkhSQd4e8iJ26k6TfDqqN9tP5Aw9l9M3qagI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00149