UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xUW1ecDgprQvl3HNe/3+Cj5KZ7MZGPiHynbyV418Iio='
WHERE
key_id = '43bdd56cdb373227a47013e65e138335b8e70b557158cd694a0d50509fbddb4f'
AND (
token = 'xUW1ecDgprQvl3HNe/3+Cj5KZ7MZGPiHynbyV418Iio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)