UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's6RVxjWyjCFcBqYj/F3xidL0zO4DTcSi9XAM0Jmq68o='
WHERE
key_id = '6d27021840fc9ef04a28a10ee1c778251a530dd2b72a7dfde2dee6536eb8faf1'
AND (
token = 's6RVxjWyjCFcBqYj/F3xidL0zO4DTcSi9XAM0Jmq68o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)