UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '62icV+3W/XnXP/aD5SGKDzRyf8lxFu8qPXcMK8IHFSY='
WHERE
key_id = 'b112eaab30900e741c35a69d46cebf5bbb22f15623f825026737dcc5b0480572'
AND (
token = '62icV+3W/XnXP/aD5SGKDzRyf8lxFu8qPXcMK8IHFSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)