UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9fa+I7gvSWkObkiUs2EQoZtUt/Ny5mVfev4ZaWHyAck='
WHERE
key_id = '28d919f76fea2f59efb9e6f25a947f93de5392e8413b9f86c73d993c66505ceb'
AND (
token = '9fa+I7gvSWkObkiUs2EQoZtUt/Ny5mVfev4ZaWHyAck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)