UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+RpVpjkxM+W02c+bNp7pRARnFfIa8f+Tff+gISWTgSA='
WHERE
key_id = '183249040be15f802b40dd965c3e67a9a949da8c460c77f6ac6a0c4e7f421891'
AND (
token = '+RpVpjkxM+W02c+bNp7pRARnFfIa8f+Tff+gISWTgSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)