UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J3anogAgdZuGi+meoq3jrB4onLRg7iSexDToOr2+hVQ='
WHERE
key_id = 'd336e96b1e738b1d2fd6fb9b322dae685606d779f07fda7d8305643bf2aedbc5'
AND (
token = 'J3anogAgdZuGi+meoq3jrB4onLRg7iSexDToOr2+hVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)