UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C3mGqrp23OXdVXuMA6hOYW1r5y+l/A5R0ndqU4EWQQ8='
WHERE
key_id = '02f7545ebc652a39d48793fa1c3a576e06a70451da350290899d0892a4b14f10'
AND (
token = 'C3mGqrp23OXdVXuMA6hOYW1r5y+l/A5R0ndqU4EWQQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)