UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'waT8tEXCNLc0PQ/PrlKFnZ1egM9542A8Ia8VQAxnBK8=' 
WHERE 
  key_id = 'b061064baf8c08f44fe399a5eb4569795971699ba4f7874ed66d24dc2d6f5a8c' 
  AND (
    token = 'waT8tEXCNLc0PQ/PrlKFnZ1egM9542A8Ia8VQAxnBK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023