UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2pM69C4IbepGGqMPsTKJs+mRbZRMQPcL+jWnHjJeVHc='
WHERE
key_id = '656d707ef824577625df7ac1e02914179a397a43d34d798ead5874a2d3acf928'
AND (
token = '2pM69C4IbepGGqMPsTKJs+mRbZRMQPcL+jWnHjJeVHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)