UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OQPpMQIDkk2fGqBoXBU68XCBHnZyLCWu0daCLy+eFR8='
WHERE
key_id = 'dfb1c80e8fe0d323a237f737ea0189ac449e09640473a6c444416459dc4bf1b8'
AND (
token = 'OQPpMQIDkk2fGqBoXBU68XCBHnZyLCWu0daCLy+eFR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)