UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7zDJIc/gplfRxVNU673WLHwCf16NLuKCBsgQ+9B9MxI=' 
WHERE 
  key_id = 'ed3c0c21844a5b8aec30b1d36a5acf476e582b2fa406c9dc199eb89e684ee7db' 
  AND (
    token = '7zDJIc/gplfRxVNU673WLHwCf16NLuKCBsgQ+9B9MxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046