UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfolf5du0mgj6EaarJ+/fssnfMMK/NMYUfb7lEVuhyY='
WHERE
key_id = 'dfc0f942536c11e78eb41412509edcc30ff1150d8439e370f9fb88821b7ac3cd'
AND (
token = 'rfolf5du0mgj6EaarJ+/fssnfMMK/NMYUfb7lEVuhyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)