UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qq1IXYiD+kT6nWexVvPPLSFmciEJu7X6/k7CW1KeN0I=' 
WHERE 
  key_id = '6ccf1153f2a8ec7bed9b9fea96f4b2d93b948ed25c525f0f0f0c88ed07c6facb' 
  AND (
    token = 'qq1IXYiD+kT6nWexVvPPLSFmciEJu7X6/k7CW1KeN0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048