UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lcd/SbFfY9wQZuGh8SvYcCzOdXwtVCZA+G21m5QUlzQ='
WHERE
key_id = 'c559cfe954184d0ed61c44dba29c2c61a15b197c746aa894715d3d4a44c775d9'
AND (
token = 'lcd/SbFfY9wQZuGh8SvYcCzOdXwtVCZA+G21m5QUlzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)