UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F6SmDol0Scw+F2pvspu3NDOFf9RYV98T6+1b+m4ZhyA=' 
WHERE 
  key_id = '6e06eccc86ed026129bd54674e0f340be5294a05436f925938e94bca4575f5b7' 
  AND (
    token = 'F6SmDol0Scw+F2pvspu3NDOFf9RYV98T6+1b+m4ZhyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026