UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gVBMk/awUzDPFPqflVHGHTyIryYf162Wgvxl6mbZX7c=' 
WHERE 
  key_id = '19bd1b0142bae28513119ab9da4e7a1b01684fa95c59e5fdbe20b91936b874c7' 
  AND (
    token = 'gVBMk/awUzDPFPqflVHGHTyIryYf162Wgvxl6mbZX7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036