UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C3w3gFQ2x7+u1Ih3yUY8mT3jzh9vTJOLB6DV0+uGLOk='
WHERE
key_id = 'be58448c168aa108eaff35437e30a1bd69e73257d53288c8a4c8b6dbfe66ac8e'
AND (
token = 'C3w3gFQ2x7+u1Ih3yUY8mT3jzh9vTJOLB6DV0+uGLOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)