UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kKocCgBUEASp7BAwOymbfFr9zmM1XSmdBIqg60mmqu8='
WHERE
key_id = '16bf7c1575dd2737eaf30fb8f1be6b9a884bd21db369d861eeb277715aab5d65'
AND (
token = 'kKocCgBUEASp7BAwOymbfFr9zmM1XSmdBIqg60mmqu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)