UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjtRkZADzT9SzZ5Oj/RIm8wiKqGPjI4tpuD6BEtg9To=' 
WHERE 
  key_id = '44ce2b3e5dd6b1aa9f3e55fdb158ca4a7a7a142ea9b01ed9fbfb8329233a6d30' 
  AND (
    token = 'cjtRkZADzT9SzZ5Oj/RIm8wiKqGPjI4tpuD6BEtg9To=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036