UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u6JuHRPCqrqYpQKD+ld4luxwk5FMVNrCH9qoo1+jBAM=' 
WHERE 
  key_id = '5e3633df52f5c776dde48ee601c44f058afacfb11226e39905754edb585358c3' 
  AND (
    token = 'u6JuHRPCqrqYpQKD+ld4luxwk5FMVNrCH9qoo1+jBAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031