UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vajWtwvuQWA3IOyIZ41H18fUUnRm2V7zxYmfyLoADiA=' 
WHERE 
  key_id = '7bcb492e3eca4dd50fdb9b093c1a7747e19f5e86c93390e3322d88fc3a97197c' 
  AND (
    token = 'vajWtwvuQWA3IOyIZ41H18fUUnRm2V7zxYmfyLoADiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016