UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kSFrEgvvwQuuH+kLj9JE4mBePtC2Z8ssweh+9/L+MA='
WHERE
key_id = '52d86a7f137ac5a4fcb0cd626d106ef651c32748fbea122d3650a69e333980b5'
AND (
token = '0kSFrEgvvwQuuH+kLj9JE4mBePtC2Z8ssweh+9/L+MA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)