UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w7u55mUiRZ/fE49Koveup6ron9kB8EKrKiLlhVSoIqM='
WHERE
key_id = '87a521b059fae5de0b165f70feafc7a88036c51413614dce66f9bc26aeaf7242'
AND (
token = 'w7u55mUiRZ/fE49Koveup6ron9kB8EKrKiLlhVSoIqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)