UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/DyCp44oOUSMsLqvf1KsY6GMVDBK7rcrwlhzs98XFcI='
WHERE
key_id = '3cd535d233231efa3527c4bc6a63cf4800ff33e95dbd92d7a44da35dc6816558'
AND (
token = '/DyCp44oOUSMsLqvf1KsY6GMVDBK7rcrwlhzs98XFcI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)