UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CLPnl+tmBnsjh5QsEmAHMI5xpKJ2lKSlipni+G5Ed0Y=' 
WHERE 
  key_id = '00f61555cc36b7bce2ca0ff051d8f48172284ce1890e13a6763d5d50e3227ae5' 
  AND (
    token = 'CLPnl+tmBnsjh5QsEmAHMI5xpKJ2lKSlipni+G5Ed0Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020