UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i1wqvW9VsFCO1P2qP5rxpPJ4MfQENd2hUDCmXkOtn/E='
WHERE
key_id = 'bec09d1ad35ec9e3b905aeb12561e8c499e2b5e589bc5544c32116086b3c388c'
AND (
token = 'i1wqvW9VsFCO1P2qP5rxpPJ4MfQENd2hUDCmXkOtn/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)