UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IB/xaAUUuDQPSKQtCJVMXDAO1xZN7mPtgmFZ2GzetBY=' 
WHERE 
  key_id = '2dc88dd6777ba977755074a1d9821442f0386638100e5898fe94380433b2feef' 
  AND (
    token = 'IB/xaAUUuDQPSKQtCJVMXDAO1xZN7mPtgmFZ2GzetBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032