UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1GlMpgRhaiq5q4pcHQhul6SkoJREZV6QLk+yjfMxjMw='
WHERE
key_id = '10b94d4aeaccfd05128741045fbc732aa7d05829441addd0dfbd685faa26fb16'
AND (
token = '1GlMpgRhaiq5q4pcHQhul6SkoJREZV6QLk+yjfMxjMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)