UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3cHfhvo0JD5sYI62kmq6oshSUtcxCcMPeyzNixWgbGM='
WHERE
key_id = '82293ec7fb0a88d6a1f696a324b9fe173334a74c9ce6e4df3ee072e9a3599598'
AND (
token = '3cHfhvo0JD5sYI62kmq6oshSUtcxCcMPeyzNixWgbGM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)