UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z0dJZ103hRK8oF08r+Vx3gJAZefAzssDO4ZMGNmZys4='
WHERE
key_id = '694484e0102aded856d097fba6df6283def8ba76918c8260573a164993477d4c'
AND (
token = 'z0dJZ103hRK8oF08r+Vx3gJAZefAzssDO4ZMGNmZys4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)