UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6jXrggcYgXDB8Xff1D55UwrW5ovduu6PLEnOtWcfsTw='
WHERE
key_id = '485fd6c93cf81ddd8567a9937f92281028e3170d791390cb7cd1b531ecd29e22'
AND (
token = '6jXrggcYgXDB8Xff1D55UwrW5ovduu6PLEnOtWcfsTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)