UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HRaJS2sH/THAeg07wnyUK5QdoLFB6qxZyjLg0V8s/aM='
WHERE
key_id = 'b976412433c113a526f3973011e64c7f318a343fbd537bd79a250fa29ef7a5d1'
AND (
token = 'HRaJS2sH/THAeg07wnyUK5QdoLFB6qxZyjLg0V8s/aM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)