UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cIF9u1dcm/T3+u0tOpIXWhVLm06OxaF8wZCCf5+Oro0='
WHERE
key_id = '4e35980de05f6de677f909d5d266fcad8ca689658adde038c6f24f40b3359b4c'
AND (
token = 'cIF9u1dcm/T3+u0tOpIXWhVLm06OxaF8wZCCf5+Oro0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)