UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HunQRvWPt9Exhk6mcwX7KNYqv4YohbwMw7InPyjBsQU='
WHERE
key_id = 'bfc1be47282226bf599ba14f16017eccaade63036be6b54a3ccdd0db8141e3c9'
AND (
token = 'HunQRvWPt9Exhk6mcwX7KNYqv4YohbwMw7InPyjBsQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)