UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UPbH+IscJZSvYIrDzIaGfkJD/ybzS5qD7IOVgd5p/L0='
WHERE
key_id = '6682443bc19050f301cc68d2a186194cff297b9d8e75d30ce22665d4defd55f1'
AND (
token = 'UPbH+IscJZSvYIrDzIaGfkJD/ybzS5qD7IOVgd5p/L0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)