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