UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hv2F1HHBsFT8P2jGtcTFxaYLk7OjkqHqUyzPeyh5shc='
WHERE
key_id = '14131561c92e143108dad5174d9eb4f81e46476c134a0cbe9af2d02991eda2a7'
AND (
token = 'Hv2F1HHBsFT8P2jGtcTFxaYLk7OjkqHqUyzPeyh5shc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)