UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9hsTUAmvH2UlmtESDinWhD6PTJ04dUvs5LevAMQNKvc='
WHERE
key_id = 'b89a21d76002f986ce9c9c0de6c9d50786656a26114286476037413be0aa9709'
AND (
token = '9hsTUAmvH2UlmtESDinWhD6PTJ04dUvs5LevAMQNKvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)