UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nLO+RgPSjzpTqoYL+11nvZu1H3ScB6W7vBMNV8hUn8Y='
WHERE
key_id = '50d6f0caa80286b0c3ae38b069577ab9ab59bca6780ea41724b69acfb8548da2'
AND (
token = 'nLO+RgPSjzpTqoYL+11nvZu1H3ScB6W7vBMNV8hUn8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)