UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ceQi70uV1I2gONjyHsCfxPTrYKUdfkjBUT+57uW9HVg='
WHERE
key_id = 'cfb0edad55e2eeabbe277d34968fe6de7f735a050e7e66ae10829f193c0ab2af'
AND (
token = 'ceQi70uV1I2gONjyHsCfxPTrYKUdfkjBUT+57uW9HVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)