UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IXN+7h/FU7MInSOe4cWGHiL6fvI2bqzr5J+qWS0Ca6o='
WHERE
key_id = 'cd8a5cc397d5e8d4109ce3c31f9e6be279cf9c96a8210c1f36664f67351a3b5f'
AND (
token = 'IXN+7h/FU7MInSOe4cWGHiL6fvI2bqzr5J+qWS0Ca6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)