UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uESQAweDy5LHOsWpszB33BYWhiSAzigQq7nCAy+IlDI=' 
WHERE 
  key_id = '6134687c3e33cc827ec71f53ce94b17570d210dddfcb7aaf73b120a73cfae369' 
  AND (
    token = 'uESQAweDy5LHOsWpszB33BYWhiSAzigQq7nCAy+IlDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017