UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nGlGStDieVkD0v29dxMgk+ev3iEZbZ0D6ICqgn2c6H8=' 
WHERE 
  key_id = 'fa7c5e95318f28853c49679c070aabe70744782fe4a0693573a2f3d7f2540104' 
  AND (
    token = 'nGlGStDieVkD0v29dxMgk+ev3iEZbZ0D6ICqgn2c6H8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027