UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BRb6dBYi9vr1qvX/abQdJMliJhfBHdJlqwbEN4DkFIk=' 
WHERE 
  key_id = '33ec540e1f8aa48e97dae7019a7773b0b01326e12645cf20569ef4e72a281656' 
  AND (
    token = 'BRb6dBYi9vr1qvX/abQdJMliJhfBHdJlqwbEN4DkFIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024