UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jck8XMhVUAif2YM+v63t9TTG0EBea35+W9NFiQ8C7+A='
WHERE
key_id = 'b596034fb417dd2e4cd6a236d648d343dc97f3d7895ab83480c94d9f6c591725'
AND (
token = 'jck8XMhVUAif2YM+v63t9TTG0EBea35+W9NFiQ8C7+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)