UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RXo4TD248KSWrDBa4v4tIN79dkd5sALrZ6VskAT8kOc='
WHERE
key_id = '8f9d09d208b869cf7617159683a688b1f5dcd6cbf97b9ce5165ce63cc3ccbbfe'
AND (
token = 'RXo4TD248KSWrDBa4v4tIN79dkd5sALrZ6VskAT8kOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)