UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QsLLwWJ/OdSswONfW3PRYIHYGHx02C9b/zi3yGVN+l4='
WHERE
key_id = 'e594424f99e84d287c5b7f2323e0d693337f07589acda3ced8eec1e463e1d631'
AND (
token = 'QsLLwWJ/OdSswONfW3PRYIHYGHx02C9b/zi3yGVN+l4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)