UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lvgnPut6DH+6g7AHbO7SQcrztCQYudCdqZKm7+2od9c='
WHERE
key_id = '0b7185c5a2be034643acf9553cb1c60670e4534a8a71436d24c34f97798ca172'
AND (
token = 'lvgnPut6DH+6g7AHbO7SQcrztCQYudCdqZKm7+2od9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)