UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I4UTVL9Q4/P/9RV5tdD0ZuDreVnnMhlBZJscsFaSDkg='
WHERE
key_id = '91cf017d75761a6c9189bc21c5f03b147255179fb22dd655cb981b9bc2e8d633'
AND (
token = 'I4UTVL9Q4/P/9RV5tdD0ZuDreVnnMhlBZJscsFaSDkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)